home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / mac / demoware / Asymptote 1.1 Demo / Scripts / Demos / 5) Three Plot / Demo5 next >
Encoding:
Text File  |  1994-11-01  |  1.6 KB  |  74 lines  |  [TEXT/DWat]

  1. % Asymptote Demo #5
  2.  
  3. % Plot the same data three different ways.
  4.  
  5. datafile Measurements
  6. datalines 2        % Start reading at line 2 (skip line 1)
  7.  
  8. graphunits inches
  9. graphframe 1 4 7 10
  10. fullscreen yes
  11.  
  12. % Read the area data from column 2, calculate 
  13. % a histogram and plot the result
  14. readcolumn x 2
  15. rpn <x log >x
  16. rpn <x >y
  17. % Find the range of values
  18. graphlimits
  19. % Count the values that fall into 12 bins that
  20. % cover the range of x values with a 0.5 unit 'margin'
  21. binxy 12 count xleft 0.5 - xright 0.5 +
  22. graphlimits
  23. plothistogram 0
  24. graphticks -1 0 0 0
  25. drawframe
  26. drawxlabel Log Area (cm\u2)
  27.  
  28. % Move the frame over by 3.5 inches then
  29. % do the same for the mass data in column 3.
  30. graphframe gleft 3.5 + gright 3.5 + gbottom gtop
  31. showgraph
  32. readcolumn x 3
  33. rpn <x log >x
  34. rpn <x >y
  35. graphlimits
  36. binxy 12 count xleft 0.5 - xright 0.5 +
  37. graphlimits
  38. plothistogram 0
  39. graphticks -1 0 0 0
  40. drawframe
  41. drawxlabel Log Mass (gm)
  42.  
  43. % Set the frame for the x,y plot
  44. graphframe 1 gright 1 gbottom 1 -
  45. showgraph
  46. readcolumn x 2
  47. readcolumn y 3
  48. closewindow \f
  49. rpn <x log >x
  50. rpn <y log >y
  51. graphlimits
  52. graphticks -1 0 -1 0
  53. pointsymbol 4 cross
  54. plotpoints
  55. % Fit the data with a powerlaw and store the
  56. % result in the y vector.
  57. powerlawfit xleft xright
  58. plotline
  59. drawframe
  60. drawxlabel Log Mass (gm)
  61. drawylabel Log Area (cm\u2)
  62. TL    % TL is a command macro that moves the pen to the top 
  63.     % left corner of the frame
  64. scale 3
  65. digits 5
  66. drawlabel belowright Mass \s¦ Area\\u\a1
  67.  
  68. % Put a frame around all three graphs
  69. % and draw a title at the top of the page.
  70. scale 1.5
  71. graphframe 1 7.5 1 10
  72. drawtitle Multiple Plots on One Page
  73.  
  74. showpage